package com.xieyong.mywebsite.service;

import com.github.pagehelper.PageInfo;
import com.xieyong.mywebsite.model.dto.Result;
import com.xieyong.mywebsite.model.entity.User;
import jakarta.servlet.http.HttpServletResponse;
import org.springframework.web.multipart.MultipartFile;

import java.io.File;
import java.util.List;
import java.util.Map;


public interface UserService {

    void register(String username, String password);

    String login(String username, String password);

    User findById(Integer id);

    User findByUserName(String username);

    List<User> getAll();

    List<User> getAllByRole(String role);

    List<User> getBatch(List<User> users, String type);

    PageInfo<User> getPage(Integer pageNum, Integer pageSize, User user);

    void add(User user);

    void update(User user);

    void updateAvatar(String avatarUrl);

    void updatePassword(Map<String, String> params,String token);

    void deleteById(Integer deleteId);

    void deleteBatch(List<Integer> ids);

    void exportBatch(HttpServletResponse response, List<User> userList, String role);

    void exportAll(HttpServletResponse response, String role);

    Result<File> importData(MultipartFile file) throws Exception;
}
